package acwing._2LanQiao._13No13;
/**
 * @Project : AlgorithmLearning
 * @Package : ACWing._2LanQiao._13No13
 * @File : Q4652.java
 * @Author : WangRuoyu
 * @Date : 2023/3/31 9:09
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Q4652 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] words = br.readLine().split(" ");
        int n = words[0].charAt(1) - '0';
        int len = 1189;
        int weight = 841;
        while (n > 0) {
            int tmp = len / 2;
            len = weight;
            weight = tmp;
            n--;
        }
        System.out.println(len);
        System.out.println(weight);
    }
}

